home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 November / CHIP Kasım 1997.iso / ARACLAR / TER500 / 500TER._XE / SCRIPT.EXE / ARRAY.TSL next >
Encoding:
Text File  |  1996-04-28  |  1.5 KB  |  41 lines

  1. % -----------------------------------------------------------------------------
  2. % Array demo                                           *TERMINATE PRESCRIPTION*
  3. % -----------------------------------------------------------------------------
  4. %
  5. %  Version          : 1.00
  6. %  Filename         : ARRAY.TSL
  7. %  Company          : SerWiz Comm
  8. %  Programmer       : Bo Bendtsen
  9. %  Module created   : 28 Apr 1996
  10. %  Latest revision  : 28 Apr 1996
  11. %  Language/version : Terminate Prescription 1.01
  12. %  Remarks          : Demonstration of how to use arrays
  13. %
  14. % -----------------------------------------------------------------------------
  15.  
  16. InitArray 1,500,100                         % Reserve 50000 bytes for array 1
  17.                                             % 1-32 can be used as arrays
  18.                                             % Elements = 500
  19.                                             % Each element = 100 bytes
  20.                                             % Max array size = 65000
  21.  
  22. If DosError=0                               % Check if array was initialised
  23.   PrintLn "Could not initialise array"
  24.   Terminate
  25. Endif
  26.  
  27. Set LineCount=0                             % Read CONFIG.SYS into array 1
  28. OpenText 1,"C:\CONFIG.SYS",0
  29. While EndofTextFile(1)=0
  30.   Set LineCount=LineCount+1
  31.   PutArray 1,LineCount,readtext(1)
  32. EndWhile
  33. CloseText 1
  34.  
  35. For Count,1,LineCount,1                     % Show CONFIG.SYS on screen
  36.   PrintLn GetArray(1,Count)
  37. Next
  38.  
  39. FreeArray 1                                 % Free memory again
  40.  
  41.